OBJ_DIR = obj
BIN_DIR = bin
CC = g++
INCLUDES = -I./src
CFLAGS = -g -Wall $(INCLUDES)
vpath %.o $(OBJ_DIR)

all: setup build

clean: 
	-rm $(OBJ_DIR)/* $(BIN_DIR)/*
	-rmdir $(OBJ_DIR) $(BIN_DIR)

setup:
	-mkdir $(OBJ_DIR) $(BIN_DIR)
	
build: objects binaries
	
objects:
	$(CC) $(CFLAGS) -o $(OBJ_DIR)/tftp-server.o -c src/tftp-server.cpp 
	
binaries: objects
	$(CC) $(CLFAGS) -o $(BIN_DIR)/tftp-server $(OBJ_DIR)/tftp-server.o 
	
